#!/bin/ksh
#
# Written by: Chuck Spilman				12/06/2002
#
# Description:
#   Lists SSA disks that are currently not being used by either the OS or other
#   applications.  Lists what size the disk is and which enclosure and slot the 
#   disk is located in.
#

printf "Please wait, this could take a while... \n\n"

for pdisk in `lsdev -Cc pdisk | awk '/SSA/{print $1}'`
do
  hdisk=`ssaxlate -l ${pdisk}`
  if [ "${hdisk}" ]
  then
	vg=`lspv |grep ${hdisk}| awk '{print $3}'| head -1`
	vgstatus=`lsvg -o | grep "${vg}"`
    if [ "${vgstatus}" = "${vg}" ]
    then
	diskinfo=`lspv -l ${hdisk}`

  	if [ ! "${diskinfo}" ]
   	then
  	  size=`lsattr -El ${pdisk} | awk '/size_in_mb/{print $2}'`
	  slot=`lsdev -Cc pdisk | grep ${pdisk} | awk -F"-" '{print $3,$4}' | head -1`
  	  echo "${hdisk}: size=${size}"
	  echo "Location: ${slot}"
	  echo
  	fi
    fi
  fi
done
